package c.b.a.c.a.c;

import java.io.InputStream;

public final class r extends q {

    /* renamed from: b  reason: collision with root package name */
    private final q f1976b;

    /* renamed from: c  reason: collision with root package name */
    private final long f1977c;

    /* renamed from: d  reason: collision with root package name */
    private final long f1978d;

    public r(q qVar, long j, long j2) {
        this.f1976b = qVar;
        long d2 = d(j);
        this.f1977c = d2;
        this.f1978d = d(d2 + j2);
    }

    private final long d(long j) {
        if (j >= 0) {
            return j > this.f1976b.a() ? this.f1976b.a() : j;
        }
        return 0;
    }

    public final long a() {
        return this.f1978d - this.f1977c;
    }

    /* access modifiers changed from: protected */
    public final InputStream b(long j, long j2) {
        long d2 = d(this.f1977c + j);
        return this.f1976b.b(d2, d(j2 + d2) - d2);
    }

    public final void close() {
    }
}
